﻿#include "string.h"

int pow(int base,int time){
	if(!time)
		return 1;
	else
		return base*pow(base,time-1);
}

char* itoa(unsigned int num){
	char *str;
	int i=0,num1=num;
	do{
		i++;
		num/=10;	
	}while(num);
	str=new char[i+1];
	str[i]=0;
	while(i){
		str[i-1]=(num1%10)+0x30;
		num1/=10;
		--i;
	}
	return str;
}

char * ftoa(float num){
        char *str=new char[11];
        int i=(int)num;
        int n=(int)((num-i)*10000);
        strcpy(str,itoa(i));    
        strcat(str,".");
        strcat(str,itoa(n));
        return str;
}
